home *** CD-ROM | disk | FTP | other *** search
- /**/
-
- call addlib("rexxmathlib.library", 5, -30, 0)
-
- options results
- parse ARG Port1 RealMain Main3_h Angle b
-
- ADDRESS value Port1
-
- Pi=3.1414926
-
- co=Cos(Angle/180*Pi)
- si=Sin(Angle/180*Pi)
-
- cx=RealMain/2
- cy=Main3_h/2
-
- x0=(0-cx)*co-((0-cy)*si-cx)
- y0=(0-cx)*si+((0-cy)*co+cy)
- x1=(0-cx)*co-((Main3_h-1-cy)*si-cx)
- y1=(0-cx)*si+((Main3_h-1-cy)*co+cy)
- x2=(RealMain-1-cx)*co-((Main3_h-1-cy)*si-cx)
- y2=(RealMain-1-cx)*si+((Main3_h-1-cy)*co+cy)
- x3=(RealMain-1-cx)*co-((0-cy)*si-cx)
- y3=(RealMain-1-cx)*si+((0-cy)*co+cy)
-
- X=MIN(x0,x1,x2,x3)
- Y=MIN(y0,y1,y2,y3)
- XX=MAX(x0,x1,x2,x3)
- YY=MAX(y0,y1,y2,y3)
-
- W=XX-X+3
- H=YY-Y+3
-
- X=X-1
- Y=Y-1
-
- pp_GetDepth
- D=result
-
- pp_GetCurrentBuffer
- CBf=result
-
- if D<24 then DO
- pp_Psave "ram:palette.trash" 0
- END
-
- pp_FindEmptyBuffer
- flag=result
- if flag=-1 then DO
- pp_Warn "can't*find*empty|Buffer."
- EXIT
- END
-
- pp_SetBuffer flag
- pp_new W H D
- pp_GetWidth
- IF result=0 then DO
- pp_Warn "Not*enough*memory."
- EXIT
- END
-
- IF D<24 then DO
- pp_Pload "ram:palette.trash"
- ADDRESS COMMAND
- 'delete >nil: ram:palette.trash'
- ADDRESS value Port1
- END
-
- Dev_Rotate X Y CBf
-
- EXIT
-